﻿<?php
 GLOBAL $CFG;
require_once('../../config.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->libdir . '/formslib.php');
require_once($CFG->dirroot . '/local/myplugin/lib.php');
require_once($CFG->dirroot . "/local/myplugin/forms.php");

global $DB;
$quick=$_GET["quick"];

/* Ket noi den file javascript - module.js */
$PAGE->requires->js_init_call('M.local_myplugin');	
$mycss =  $CFG->wwwroot.'/local/myplugin/css/mycss.css';

 echo '<link rel="stylesheet" href="'.$mycss.'" type="text/css" media="screen" />';

/* Viet doan code cua ban o day */
//add tab vào trang

$choose_block_knowledge_form = new form_add_block_knowledge();
//bat su kien nhan nu cancel
//kiem tra neu dc submitted thì làm gì
if ($fromform = $choose_block_knowledge_form->get_data()) 
{
		$option['bok_id']=$fromform->txtid;
		$option['bok_name']=$fromform->txtten;
		$option['bok_credit']=$fromform->txttinchi;
		
		$mylib = new curriculum_management();
		$mylib->add_block_knowledge($option);
		//close colorbox
		echo "<script>parent.$.fn.colorbox.close(); </script>";
}

$choose_block_knowledge_form->display();
/*------Ket thuc doan code cua ban-------*/


